package com.rs.service;

import com.rs.mapper.BookMapper;
import com.rs.pojo.Books;

import java.util.List;

public class BookServiceImpl implements BookService {
    //service 调用 dao

    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int addBooks(Books books) {
        return bookMapper.addBooks(books);
    }

    public int deleteBooks(int id) {
        return bookMapper.deleteBooks(id);
    }

    public int updateBooks(Books books) {
        return bookMapper.updateBooks(books);
    }

    public Books queryById(int id) {
        return bookMapper.queryById(id);
    }

    public List<Books> queryAll() {
        return bookMapper.queryAll();
    }

    public List<Books> queryBooksByName(String bookName) {
        return bookMapper.queryBooksByName(bookName);
    }
}
